Show AllShow All

Convert Method

Converts the current diagram to a different diagram.

expression.Convert(Type)

expression    Required. An expression that returns one of the objects in the Applies To list.

Type   Required MsoDiagramType. The type of diagram to convert to.

Example

This example adds a radial diagram to the active worksheet and then converts it to a target diagram.

Sub ConvertDiagram()

    Dim wksSheet As Worksheet
    Dim shDiagram As Shape

    Set wksSheet = ActiveSheet
    Set shDiagram = wksSheet.Shapes.AddDiagram( _
        Type:=msoDiagramRadial, _
        Left:=20, Top:=40, _
        Width:=400, Height:=200)

    ' Fill the diagram to make it visible to the user
    shDiagram.Fill.Visible = msoTrue

    ' Convert the diagram.
    shDiagram.Diagram.Convert Type:=msoDiagramTarget

End Sub